/*************************************************************************
    > File Name: myproc.c
    > Author: ma6174
    > Mail: ma6174@163.com 
    > Created Time: Sun 27 Oct 2024 08:52:44 PM CST
 ************************************************************************/

#include<stdio.h>
#include <unistd.h>
int main(int argc, char* argv[], char* env[])
{
    if (argc == 2)//针对cd指令模拟切换路径如：./myproc / 有两个参数，所以argc为2
    {
        printf("change begin\n");
        sleep(20);
        chdir(argv[1]);
        printf("change done\n");
        sleep(10);
        printf("exit\n");
    }
    else
    {
        printf("err\n");

    }

    return 0;
}

